package chainOfResponsibilityPattern;

// Handler具体实现类--C：处理1000以下请求
public class ConcreteHandlerC extends Handler {

    public ConcreteHandlerC(Handler nextHandler) {
        super(nextHandler);
    }

    @Override
    void handleRequest(Double amount) {
        if (amount <= 1000) {
            System.out.println("C审批通过，金额: " + amount);
        } else if (nextHandler != null) {
            System.out.println("C无法审批，转交给下一级");
            nextHandler.handleRequest(amount);
        } else {
            System.out.println("无人可以处理该请求");
        }
    }
}
